<?php
if (YII_ENV == 'dev') {
    $db = [
        'class' => 'yii\db\Connection',
        'dsn' => 'mysql:host=rm-2zeg2c021e8mc547ko.mysql.rds.aliyuncs.com;dbname=saletest',
        'username' => 'xiaoshouhui',
        'password' => 'lexiao99',
        'charset' => 'utf8',
    ];
} elseif (YII_ENV == 'prod') {
    $db = [
        'class' => 'yii\db\Connection',
        'dsn' => 'mysql:host=rm-2zeg2c021e8mc547k.mysql.rds.aliyuncs.com;dbname=sale',
        'username' => 'xiaoshouhui',
        'password' => 'lexiao99',
        'charset' => 'utf8',
    ];
} else {
    $db = [
        'class' => 'yii\db\Connection',
        'dsn' => 'mysql:host=192.168.2.200;dbname=saletest',
        'username' => 'root',
        'password' => 'zyj520hm',
        'charset' => 'utf8',
    ];
}
$config = [
    'components' => [
        'user' => [
            'class' => 'yii\web\User',
            'identityClass' => 'api\modules\v1\models\Login',
            'enableAutoLogin' => true,
            'enableSession' => false,
            'loginUrl' => null
        ],
        'db' => $db
    ],
];
return $config;
